Module XBotNet
    Public gStrTCLScriptDir As String = My.Application.Info.DirectoryPath & "\xtcllib\scripts"

    Public Sub RaiseError(ByRef Msg As String, Optional ByRef Critical As Boolean = False)
        ' Purpose:
        ' --------
        '   Generic error display mechanism for all of X-Bot .NET
        '
        ' Preconditions:
        ' --------------
        '   An error has occured
        '
        '   An error message describing what the program was attempting to do
        '       and how the user can attempt to avoid the error in the future
        '       has been passed in as Msg
        '
        '   Critical is defined and set to be True if this is a 
        '       critical error and X-Bot must be shut down
        '
        ' Postconditions:
        ' ---------------
        '   Error has been displayed
        '   Program has been terminated as needed

        Dim strMsgboxTitle As String
        strMsgboxTitle = My.Application.Info.ProductName.ToString & " ERROR:"

        Msg = My.Application.Info.ProductName.ToString & " " & My.Application.Info.Version.ToString & " has encountered the following error: " & vbCrLf & vbCrLf & Msg

        If Critical Then
            Msg = Msg & vbCrLf & vbCrLf & "This error has been deemed critical and X-Bot will now terminate."
            MsgBox(Msg, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly + MsgBoxStyle.SystemModal, strMsgboxTitle)
            End
        Else
            Msg = Msg & vbCrLf & vbCrLf & "X-Bot will now attempt to continue to operate despite this error."
            MsgBox(Msg, MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, strMsgboxTitle)
        End If
    End Sub

    Public Sub Preloader()
        ' Purpose:
        '   Performs any setting grabbing before forms are loaded

    End Sub
End Module
